package main

import (
	"fyne.io/fyne/v2/app"
	"fyne.io/fyne/v2/container"
	"fyne.io/fyne/v2/theme"
	"fyne.io/fyne/v2/widget"
)

func main() {
	//	创建一个APP
	a := app.New()
	// 给APP创建个一个窗口，NewWindow 函数需要传入一个窗口的命名
	w := a.NewWindow("Achou.Wang")
	// 创建一个按钮，按钮点击之后会退出程序
	quit := widget.NewButton("quit", func() {
		a.Quit()
	})

	quitWithItem := widget.NewButtonWithIcon("Cancel", theme.CancelIcon(), func(){a.Quit()})
	quitWithItem.Importance = widget.HighImportance

	acc := widget.NewAccordion(
		widget.NewAccordionItem("A", widget.NewLabel("Hidden")),
		widget.NewAccordionItem("B", widget.NewLabel("Shown item")),
		widget.NewAccordionItem("C", widget.NewLabel("End")),
		widget.NewAccordionItem("Q", quit),
		widget.NewAccordionItem("U", quitWithItem),
		)
	acc.Items[0].Open = true


	w.SetContent(container.NewVBox(
		acc,
		))

	// 将窗口显示处理
	w.ShowAndRun()
}
